home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0514.ZIP
/
CRAYZ15.ARC
/
VCODR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-08-01
|
4KB
|
99 lines
{ Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, NY 13730 }
program main ;
{ Program: LINPACK SGECO and SGEFA Test Driver. }
{ }
{ Version: Date: }
{ }
{ 1.5/TURBO Pascal 3.0 08/02/86 }
{ }
{ Description: }
{ }
{ Uses LINPACK SGECO and SGEFA to compute }
{ condition estimate RCond for matrices. }
{ A is set up as a Hilbert matrix of specified }
{ order and SGECO is called to compute the RCond }
{ measure. If PrintCode <> 0 then printout will }
{ include RCond and 'folded' RCond where; }
{ folded RCond = (1.0+RCond)-1.0 }
{ }
{ Author: }
{ }
{ Adam Fritz }
{ 133 Main Street }
{ Afton, New York 13730 }
{-I DizZ.con CONSTANT Declarations }
{-I DizZ.typ TYPE Declarations }
{-I DizZ.var VARIABLE Declarations }
{$I CrayZ.con CONSTANT Declarations }
{$I CrayZ.typ TYPE Declarations }
{$I CrayZ.var VARIABLE Declarations }
aaID : vARRAY ;
i, j : integer ;
{-I DizZ.pas Vector Read/Write Routines }
{$I DrivZ.pas Vector Read/Write Routines }
{-I CGen.pas Test System Generator }
{$I HilGen.pas Test System Generator }
{-I VectScal.p MathPak (C) Routine Package }
{-I SkipVS.p MathPak (C) Routine Package }
{-I mpBLAS.pas MathPak (C) BLAS }
{$I BLAS.pas Basic Linear Algebra }
{$I vSGEFA.pas LINPACK Factor }
{$I vSGETP.pas Virtual Array Transpose }
{$I vSGECO.pas LINPACK Condition }
{$I vOUT.pas Virtual Array Output }
{$I OUT.pas SICE Output Routine }
begin
{ Initialize }
writeln('LINPACK SGECO and SGEFA Test Program, CrayZ Version 1.5.') ;
writeln ;
{ Get Order }
n := 0 ;
while (n < 1) or (n > lda) do begin
write('Order: ') ;
readln(n)
end ;
{ Allocate Matrix }
vCreate (aID,'aMATRIX.$$$',n) ;
{ Get Print Code }
write('Print Code: ') ;
readln (PrintCode) ;
{ Generate Test System }
SYSGEN (aID, lda, n, b) ;
if PrintCode > 0 then begin
writeln ;
writeln('Original System (by column):') ;
writeln ;
vOUT (aID, n) ;
OUT (b[1], lda, n, 1)
end ;
{ Allocate Transpose Matrix. }
vCreate (aaID,'aaMATRIX.$$$',n) ;
{ Fill Transpose Matrix. }
for i := 1 to n do
Aj[i] := 0.0 ;
for j := 1 to n do
VectorWrite (aaID,n,1,j,n,Aj) ;
{ Compute the Condition }
vSGECO (aID, aaID, lda, n, IPvt, RCond, Work) ;
writeln ;
write('RCond: ',RCond:14) ;
RCond := (1.0 + RCond) - 1.0 ;
writeln(', RCond: ',RCond:14) ;
writeln ;
{ Close }
vClose (aaID) ;
vClose (aID) ;
{ Done }
writeln('End of Test.')
end.
{ Copyright (C) 1986 Adam Fritz, 133 Main St., Afton, NY 13730 }